package com.aizuda.boot.modules.business.template.entity.vo;

import com.aizuda.boot.modules.business.contract.entity.vo.ContractFormDataDTO;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.List;

@Data
@Schema(description = "合同模板草稿列表响应")
public class ContractTemplateDraftListRespDTO {

    @Schema(description = "合同类型分组列表")
    private List<ContractTypeGroup> contractTypeGroups;

    @Data
    @Schema(description = "合同类型分组")
    public static class ContractTypeGroup {
        @Schema(description = "合同类型ID")
        private Integer contractTypeId;

        @Schema(description = "合同类型名称")
        private String contractTypeName;

        @Schema(description = "该类型下的模板列表")
        private List<TemplateDraft> templates;
    }

    @Data
    @Schema(description = "模板草稿信息")
    public static class TemplateDraft {
        @Schema(description = "模板ID")
        private Integer templateId;

        @Schema(description = "模板名称")
        private String templateName;

        @Schema(description = "模板编号，格式：年月日+序号，如：202506300001")
        private String templateCode;

        @Schema(description = "使用说明")
        private String usageInstructions;

        @Schema(description = "创建时间")
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        private LocalDateTime createdAt;

        @Schema(description = "更新时间")
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        private LocalDateTime updatedAt;
        
        @Schema(description = "合同表单数据")
        private ContractFormDataDTO content;
    }
} 